package com.xxbb.chapter_1.dome2_avg;






import java.util.ArrayList;
import java.util.Collections;
import java.util.Scanner;

public class Program {
    public static void main(String[] args) {
        ArrayList<Integer> numbers = new ArrayList<Integer>();
        for (int i = 0; i < 10; i++) {
            System.out.println("请输入第" + (i + 1) + "个评委的分数：");
            Scanner scanner = new Scanner(System.in);
            int number =scanner.nextInt();
            numbers.add(number);
        }
        System.out.println(numbers.size() + "个评委的分数是：" +numbers.toString());
        Integer min = (Integer) Collections.min(numbers);
        Integer max = (Integer) Collections.max(numbers);
        System.out.println("去掉一个最高分："+max);
        System.out.println("去掉一个最低分："+min);
        numbers.remove(min);
        numbers.remove(max);
        Double sum = 0.0;
        for (Integer item : numbers) {
            sum+=item;
        }
        System.out.println("最后得分："+(sum/numbers.size()));
    }
}
